/*
 * UeyeCameraImpl.h
 *
 *  Created on: 22.03.2013
 *      Author: OrGeJs
 */

#ifndef UEYECAMERAIMPL_H_
#define UEYECAMERAIMPL_H_

#pragma once
#include <string>
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "../header/UEyeOpenCVException.h"
#include "../includes/uEye/uEye.h"
#include "../header/ICamera.h"
#include "../includes/uEye/uEye.h"
using namespace cv;
using namespace std;

class UeyeCameraImpl: public virtual ICamera {
private:

	UEYE_CAMERA_INFO cameraInfo; // is_GetCameraInfo()
	HIDS cameraHandle; //is_GetCameraInfo()
	DisplayMode displayMode;
	Mat mat;
	CameraParameter params;
	SENSORINFO sInfo;

public:
	UeyeCameraImpl();
	virtual ~UeyeCameraImpl();

	ErrorCode openCamera();
	ErrorCode closeCamera();

	ErrorCode captureVideo();
	ErrorCode stopVideo();

	ErrorCode getImageFormat(uint16_t *width, uint16_t *height);
	ErrorCode setImageFormat(uint16_t *width, uint16_t *height);

	ErrorCode setFrameRate(uint16_t *frameRate);
	ErrorCode getFrameRate(uint16_t *frameRate);

	ErrorCode setExposureTime(uint16_t *exposureTime);
	ErrorCode getExposureTime(uint16_t *exposureTime);

	ErrorCode setPixelRate(uint16_t *pixelRate);
	ErrorCode getPixelRate(uint16_t *pixelRate);

	ErrorCode setAutoPameter();
	ErrorCode getAllPameter();

	ErrorCode getId(uint8_t *id);

	ErrorCode resetToDefault();
	string getErrors();

	DisplayMode getDisplayMode();
	void setDisplayMode(DisplayMode dispMode);
	void getFrame(cv::Mat& mat);
};

#endif /* UEYECAMERAIMPL_H_ */
